From: Jonas Dreßler Date: Thu, 21 Nov 2019 12:05:04 +0000 (+0700) Subject: st/icon: Use own methods for updating GIcon when setting icon names X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~215 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=69a5e89096074cdce6a43060f8b7654639d7d5e2;p=gnome-shell.git st/icon: Use own methods for updating GIcon when setting icon names Instead of reimplementing the functions to set the GIcon inside the `set_*_icon_name` functions, just use the already defined methods for that. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888 --- diff --git a/src/st/st-icon.c b/src/st/st-icon.c index 13f7dd54f..8b8dbc2ff 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -549,7 +549,6 @@ void st_icon_set_icon_name (StIcon *icon, const gchar *icon_name) { - StIconPrivate *priv = icon->priv; GIcon *gicon = NULL; g_return_if_fail (ST_IS_ICON (icon)); @@ -557,26 +556,12 @@ st_icon_set_icon_name (StIcon *icon, if (icon_name) gicon = g_themed_icon_new_with_default_fallbacks (icon_name); - if (g_icon_equal (priv->gicon, gicon)) /* do nothing */ - { - if (gicon) - g_object_unref (gicon); - return; - } - - if (priv->gicon) - g_object_unref (priv->gicon); - g_object_freeze_notify (G_OBJECT (icon)); - priv->gicon = gicon; - - g_object_notify_by_pspec (G_OBJECT (icon), props[PROP_GICON]); + st_icon_set_gicon (icon, gicon); g_object_notify_by_pspec (G_OBJECT (icon), props[PROP_ICON_NAME]); g_object_thaw_notify (G_OBJECT (icon)); - - st_icon_update (icon); } /** @@ -741,7 +726,6 @@ void st_icon_set_fallback_icon_name (StIcon *icon, const gchar *fallback_icon_name) { - StIconPrivate *priv = icon->priv; GIcon *gicon = NULL; g_return_if_fail (ST_IS_ICON (icon)); @@ -749,19 +733,10 @@ st_icon_set_fallback_icon_name (StIcon *icon, if (fallback_icon_name != NULL) gicon = g_themed_icon_new_with_default_fallbacks (fallback_icon_name); - if (g_icon_equal (priv->fallback_gicon, gicon)) /* do nothing */ - { - if (gicon) - g_object_unref (gicon); - return; - } - - if (priv->fallback_gicon) - g_object_unref (priv->fallback_gicon); - - priv->fallback_gicon = gicon; + g_object_freeze_notify (G_OBJECT (icon)); + st_icon_set_fallback_gicon (icon, gicon); g_object_notify_by_pspec (G_OBJECT (icon), props[PROP_FALLBACK_ICON_NAME]); - st_icon_update (icon); + g_object_thaw_notify (G_OBJECT (icon)); }